// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import html2canvas from 'html2canvas'
import npmDonewsTest from 'npm-donews-test'
import 'element-ui/lib/theme-chalk/index.css'
import * as filters from './filters'
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.use(ElementUI)
Vue.use(npmDonewsTest)
Vue.config.productionTip = false
Vue.config.devtools = false
// Vue.config.warnHandler = function (msg, vm, trace) {
//   console.log('----------------------------')
//   console.log(msg)
//   console.log('----------------------------')
//   console.log(vm)
//   console.log('----------------------------')
//   console.log(trace)
//   console.log('----------------------------')
// }

// Vue.config.errorHandler = function (err, vm, info) {
//   // handle error
//   // `info` 是 Vue 特定的错误信息，比如错误所在的生命周期钩子
//   // 只在 2.2.0+ 可用
//   console.log('----------------------------')
//   console.log(err)
//   console.log('----------------------------')
//   console.log(vm)
//   console.log('----------------------------')
//   console.log(info)
//   console.log('----------------------------')
// }
Vue.config.keyCodes = {
  'haha': 86
}
Vue.prototype.$alert = ElementUI.MessageBox.alert
Vue.prototype.$message = ElementUI.message
Vue.prototype.$html2canvas = html2canvas
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
